<template>
  <div class="detail-content-forth">
    <detail-body title="热门评论" :more="`查看全部${comment.totalCount}评论`">
        <div class="top">
            <div class="left">
                <div class="text">
                    {{ comment.overall }}
                </div>
            </div>
            <div class="middle">
                <div class="title">{{ comment.scoreTitle }}</div>
                <div class="all"> {{ comment.totalCount }}条评论</div>
                <div> <van-rate v-model="comment.overall" readonly allow-half /> </div>
            </div>
            <div class="right">
                <template v-for="item in comment.subScores">
                    <div class="item">{{ item }}</div>
                </template>
            </div>
        </div>

        <div class="content">
            <template v-for="(item,index) in comment.commentTagVo" :key="index">
                <div :style="{color:item.color,backgroundColor:item.backgroundColor}" class="text">
                    {{ item.text }}
                </div>
            </template>
        </div>

        <div class="people">
            <div class="top">
                <img :src="comment.comment.userAvatars" alt="">
                <div class="info">
                    <div>{{ comment.comment.userName }}</div>
                    <div class="time">{{ comment.comment.checkInDate }}</div>
                </div>
            </div>
            {{ comment.comment.commentDetail }}
        </div>
    </detail-body>
  </div>
</template>

<script setup>
import DetailBody from '@/components/detail-body/detail-body.vue';
defineProps({
    comment:{
        type:Object,
        default:() =>({})
    }
})
</script>

<style lang="less" scoped>
    .detail-content-forth {
        .top {
            padding: 10px;
            display: flex;
            .left {
                width: 65px;
                height: 100%;
                color: #333;
                font-size: 16px;
                font-weight: 700;
                border-bottom: 10px solid #fa8c1d;
                border-radius: 53px;
                .text {
                    font-size: 48px;
                }
            }
            .middle {
                display: flex;
                flex-direction: column;
                justify-content: start;
                margin-left: 10px;
                margin-right: 5px;
                .all {
                    color: #999;
                }
            }
            .right {
                flex: 1;
                display: flex;
                justify-content: flex-end;
                flex-wrap: wrap;
                font-size: 12px;
                color: #666;
                .item {
                    margin: 0 4px;
                }
            }
        }

        .content {
            display: flex;
            flex-wrap: wrap;
            justify-content: start;
            font-size: 12px;
            .text {
                margin: 5px;
                border-radius: 50%;
                padding: 3px 5px;
            }
        }

        .people {
            background: #f7f9fb;
            padding: 0 5px 10px;
            margin-bottom: 5px;
            .top {
                display: flex;
                img {
                    width: 40px;
                    border-radius: 50%;
                    margin-right: 20px;
                }
                .info {
                    display: flex;
                    flex-direction: column;
                    .time {
                        padding-top: 4px;
                        color: #999;
                    }
                }
            }
        }
    }
</style>